package condition;

import java.util.ArrayList;

public class ConditionGroup<ValueType> {
	ArrayList<Condition<?>> conditions;
	private String name;
	private String type;
	private ValueType value;
	
	public ConditionGroup(ArrayList<Condition<?>> conditions, String name, String type, ValueType value) {
		this.conditions = conditions;
		this.name = name;
		this.type = type;
		this.value = value;
	}
	
	public boolean evaluate() {
		for (Condition<?> condition : this.conditions) {
			if (condition.evaluate() == false) {
				return false;
			}
		}
		
		return true;
	}
	
	public String getName() {
		return this.name;
	}
	public String getType() {
		return this.type;
	}
	public ValueType getValue() {
		return this.value;
	}
}
